﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx;
using Styx.Plugins;
using Styx.Common;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using System.Windows.Media;
using System.Threading;
using Bots.Gatherbuddy;

namespace KamDruidFarmer
{
    public class KamPlugin : HBPlugin
    {
        public override string Author { get { return "Kam"; } }
        public override Version Version { get { return new Version(1, 0, 0); } }
        public override string Name { get { return "Kam Druid Farmer"; } }
        public override bool WantButton { get { return true; } }
        public override string ButtonText { get { return "Show Options"; } }
        private static frmMain form = null;

        public override void OnButtonPress()
        {
            form = new frmMain();
            form.Show();
        }

        public override void Pulse()
        {
            int nofm = NumberofMobs();
            if (nofm > 1)
            {
                var intpoint WoWPoint = "";
                GatherbuddyBot.BlacklistNodes.Add(WoWPoint)
            }
            slog("hey");
        }

        private void slog(string format, params object[] args)
        {
            Logging.Write("[Kam] " + format, args);
        }



        public int NumberofMobs()
        {
            var node = ObjectManager.GetObjectsOfType<WoWGameObject>().Where(e => e.IsHerb || e.IsMineral).OrderBy(n => n.Distance).FirstOrDefault();
            var mobCount = node == null ? 0 : ObjectManager.GetObjectsOfType<WoWUnit>().Where(e => e.IsHostile).Count(u => u.Location.Distance(node.Location) < 20);
            return mobCount;
        }
    }
}

